// ask a player to play a game
$("#usersList option").live("dblclick", function (event)
{
    $('#message').text("Request was sent to " + event.currentTarget.text);
    objCommandee.gameRequest(objCommandee, objWebSocket.socket, event.currentTarget.value);
});

// send chat message
$("#chatMsg").bind('keypress', function (event)
{
    if ($("#chatMsg").val() === "") return;

    var code = (event.keyCode ? event.keyCode : event.which);
    if (code == 13)
    {
        objCommandee.sendChatMsg(objCommandee, objWebSocket.socket, $("#chatMsg").val());
        $("#chatMsg").val('');
    }
});
